// Part is the data structure for a single part of the video stream information.
export interface Part {
  url: string;
  size: number;
  ext: string;
}

// Stream is the data structure for each video stream, eg: 720P, 1080P.
export interface Stream {
  // eg: "1080"
  id?: string;
  // eg: "1080P xxx"
  quality?: string;
  // [Part: {URL, Size, Ext}, ...]
  // Some video stream have multiple parts,
  // and can also be used to download multiple image files at once
  parts: Part[];
  // total size of all urls
  size: number;
  // the file extension after video parts merged
  ext?: string;
  // if the parts need mux
  needMux?: boolean;
}

export enum IMediaType {
	Image = 'image',
	Video = 'video',
}

export interface IMedia {
	type: IMediaType;
	data: string;
}

export interface IData {
	ok: boolean;
	data: IMedia[];
}

export interface IError {
	ok: boolean;
	data: string;
}
